package cn.heycm.blog.common.entity.result;

import lombok.Getter;

/**
 * 响应码
 *
 * @author hey
 * @version 1.0
 * @since 2024/9/15 15:32
 */
@Getter
public enum CodeMsg {

    SUCCESS(200, "成功"),

    // 系统运行异常
    UNKNOWN_ERROR(500, "未知错误"),
    INVALID_PARAM(400, "参数错误"),
    DENIED_REQUEST(403, "拒绝访问"),
    RESOURCE_NOT_FOUND(404, "资源不存在"),

    // 系统业务错误:10000~19999
    CFG_EXISTS(10000, "配置项已存在"),
    CFG_NOT_EXISTS(10001, "配置项不存在"),

    // 后台用户错误:11000~11999
    DENY_LOGIN(11000, "手机号错误或账户已停用，请联系管理员"),
    SEND_VERIFY_CODE_FAIL(11001, "短信验证码发送失败，请稍后重试"),
    VERIFY_CODE_INVALID(11002, "验证码错误"),

    // 文章错误:12000~12999
    ARTICLE_NOT_EXISTS(12000, "文章不存在");

    private final int code;

    private final String msg;

    CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
